﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FortuneHeavenBAL;
using FortuneHeavenCommon.DataMap;

namespace FortuneHeaven.Admin
{
    /// <summary>
    /// IPAnalysis 的摘要说明
    /// </summary>
    public class IPAnalysis : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string ip = context.Request["ip"];
            if (!string.IsNullOrEmpty(ip))
            {
                IPRecordBO bo = new IPRecordBO();
                IPRecord record = bo.GetIPRecord(ip);
                if (record != null)
                {
                    context.Response.Write((record.Pos != null ? record.Pos : "") + " " + record.Detail != null ? record.Detail : "");
                }
            }
            context.Response.End();
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}